package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity/*跟踪记录表*/
public class Dtail {
    private int tailId;
    private Dbusiness busId;
    private Integer clientId;
    private Integer linkmanId;
    private String tailRecord;
    private Timestamp tailNexttime;
    private Timestamp tailNowtime;
    private String tailPeople;
    private Dttemplate ttemplateId;
    private Dtype type;

    @Id
    @Column(name = "tail_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "dtail")
    public int getTailId() {
        return tailId;
    }

    public void setTailId(int tailId) {
        this.tailId = tailId;
    }

    @ManyToOne
    @JoinColumn(name = "bus_id",referencedColumnName = "bus_id")
    public Dbusiness getBusId() {
        return busId;
    }

    public void setBusId(Dbusiness busId) {
        this.busId = busId;
    }


    @Basic
    @Column(name = "client_id")
    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = clientId;
    }

    @Basic
    @Column(name = "linkman_id")
    public Integer getLinkmanId() {
        return linkmanId;
    }

    public void setLinkmanId(Integer linkmanId) {
        this.linkmanId = linkmanId;
    }

    @Basic
    @Column(name = "tail_record")
    public String getTailRecord() {
        return tailRecord;
    }

    public void setTailRecord(String tailRecord) {
        this.tailRecord = tailRecord;
    }

    @Basic
    @Column(name = "tail_nexttime")
    public Timestamp getTailNexttime() {
        return tailNexttime;
    }

    public void setTailNexttime(Timestamp tailNexttime) {
        this.tailNexttime = tailNexttime;
    }

    @Basic
    @Column(name = "tail_nowtime")
    public Timestamp getTailNowtime() {
        return tailNowtime;
    }

    public void setTailNowtime(Timestamp tailNowtime) {
        this.tailNowtime = tailNowtime;
    }

    @Basic
    @Column(name = "tail_people")
    public String getTailPeople() {
        return tailPeople;
    }

    public void setTailPeople(String tailPeople) {
        this.tailPeople = tailPeople;
    }



    @ManyToOne
    @JoinColumn(name = "type_id",referencedColumnName = "type_id")
    public Dtype getType() {
        return type;
    }


    public void setType(Dtype type) {
        this.type = type;
    }

    @ManyToOne
    @JoinColumn(name = "ttemplate_id",referencedColumnName = "ttemplate_id")
    public Dttemplate getTtemplateId() {
        return ttemplateId;
    }

    public void setTtemplateId(Dttemplate ttemplateId) {
        this.ttemplateId = ttemplateId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Dtail dtail = (Dtail) o;
        return tailId == dtail.tailId &&
                Objects.equals(busId, dtail.busId) &&
                Objects.equals(clientId, dtail.clientId) &&
                Objects.equals(linkmanId, dtail.linkmanId) &&
                Objects.equals(tailRecord, dtail.tailRecord) &&
                Objects.equals(tailNexttime, dtail.tailNexttime) &&
                Objects.equals(tailNowtime, dtail.tailNowtime) &&
                Objects.equals(tailPeople, dtail.tailPeople);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tailId, busId, clientId, linkmanId, tailRecord, tailNexttime, tailNowtime, tailPeople);
    }

    @Override
    public String toString() {
        return "Dtail{" +
                "tailId=" + tailId +
                ", busId=" + busId +
                ", clientId=" + clientId +
                ", linkmanId=" + linkmanId +
                ", tailRecord='" + tailRecord + '\'' +
                ", tailNexttime=" + tailNexttime +
                ", tailNowtime=" + tailNowtime +
                ", tailPeople='" + tailPeople + '\'' +
                ", ttemplateId=" + ttemplateId +
                ", typeId=" + type +
                '}';
    }
}
